feat: U8x64 byte-level ops for palette codec, nibble, byte scan (Pumpkin/SD) Added to all three tiers (AVX-512 / AVX2 / scalar): cmpeq_mask(other) → u64 — byte-wise equality, returns bitmask shr_epi16(imm) → Self — shift right 16-bit lanes (nibble extract) saturating_sub(other) — max(a-b, 0) per byte (delta subtraction) unpack_lo_epi8(other) — interleave low bytes (nibble interleave) unpack_hi_epi8(other) — interleave high bytes These operations are used by: palette_codec.rs — Minecraft-style variable-width bit packing nibble.rs — 4-bit light level packing (Pumpkin) byte_scan.rs — NBT format byte scanning (future) stable_diffusion/ — VAE latent palette encoding via GGUF All three are currently using raw _mm256_/_mm512_ intrinsics. Next step: rewire them to use crate::simd::U8x64 instead. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp#76
Merged
Conversation
…ection BF16↔f32 batch conversion via stable Rust 1.94: 1. Runtime detect avx512bf16 + avx512vl 2. as_chunks::<16>() → _mm512_cvtpbh_ps (16 BF16 → 16 f32) 3. as_chunks::<8>() remainder → _mm256_cvtpbh_ps (8 BF16 → 8 f32) 4. Scalar tail → f32::from_bits((bits as u32) << 16) No LazyLock — slice chunking handles batch widths. No nightly — as_chunks is stable since 1.94. Reference: https://doc.rust-lang.org/beta/src/core/stdarch/crates/core_arch/src/x86/avx512bf16.rs.html Types: BF16x16 (__m256bh), BF16x8 (__m128bh) — available when target_feature avx512bf16 is enabled at compile time. Functions (always available, scalar fallback built in): bf16_to_f32_batch(input: &[u16], output: &mut [f32]) f32_to_bf16_batch(input: &[f32], output: &mut [u16]) bf16_to_f32_scalar(bits: u16) → f32 f32_to_bf16_scalar(v: f32) → u16 3 tests passing. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp
…y_windows dispatch
Compile-time const (not LazyLock) — resolved by #[cfg(target_feature)]:
AVX-512: F64=8, F32=16, U64=8, I16=32
AVX2: F64=4, F32=8, U64=4, I16=16
Scalar: same as AVX2
Enables consumers to use array_windows::<{PREFERRED_F64_LANES}>()
for native-width SIMD processing without runtime branching.
https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp
…kin/SD) Added to all three tiers (AVX-512 / AVX2 / scalar): cmpeq_mask(other) → u64 — byte-wise equality, returns bitmask shr_epi16(imm) → Self — shift right 16-bit lanes (nibble extract) saturating_sub(other) — max(a-b, 0) per byte (delta subtraction) unpack_lo_epi8(other) — interleave low bytes (nibble interleave) unpack_hi_epi8(other) — interleave high bytes These operations are used by: palette_codec.rs — Minecraft-style variable-width bit packing nibble.rs — 4-bit light level packing (Pumpkin) byte_scan.rs — NBT format byte scanning (future) stable_diffusion/ — VAE latent palette encoding via GGUF All three are currently using raw _mm256_/_mm512_ intrinsics. Next step: rewire them to use crate::simd::U8x64 instead. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.